package org.dyndns.doujindb.db.cayenne.auto;

import java.util.Date;
import java.util.Set;

import org.apache.cayenne.CayenneDataObject;
import org.dyndns.doujindb.db.cayenne.Artist;
import org.dyndns.doujindb.db.cayenne.Circle;
import org.dyndns.doujindb.db.cayenne.Content;
import org.dyndns.doujindb.db.cayenne.Convention;
import org.dyndns.doujindb.db.cayenne.Parody;
import org.dyndns.doujindb.db.records.Book.Rating;
import org.dyndns.doujindb.db.records.Book.Type;

/**
 * Class _Book was generated by Cayenne.
 * It is probably a good idea to avoid changing this class manually,
 * since it may be overwritten next time code is regenerated.
 * If you need to make any customizations, please use subclass.
 */
@SuppressWarnings("serial")
public abstract class _Book extends CayenneDataObject {

    public static final String ADULT_PROPERTY = "adult";
    public static final String COLOR_PROPERTY = "color";
    public static final String DECENSORED_PROPERTY = "decensored";
    public static final String INFO_PROPERTY = "info";
    public static final String JAPANESE_NAME_PROPERTY = "japaneseName";
    public static final String PAGES_PROPERTY = "pages";
    public static final String PUBLISHED_PROPERTY = "published";
    public static final String RATING_PROPERTY = "rating";
    public static final String ROMAJI_NAME_PROPERTY = "romajiName";
    public static final String TRANSLATED_PROPERTY = "translated";
    public static final String TRANSLATED_NAME_PROPERTY = "translatedName";
    public static final String TYPE_PROPERTY = "type";
    public static final String ARTISTS_PROPERTY = "artists";
    public static final String CIRCLES_PROPERTY = "circles";
    public static final String CONTENTS_PROPERTY = "contents";
    public static final String CONVENTIONOF_PROPERTY = "conventionof";
    public static final String PARODIES_PROPERTY = "parodies";
    public static final String RECYCLED_PROPERTY = "recycled";

    public static final String ID_PK_COLUMN = "ID";
    
    public Integer getID() {
    	return (Integer) getObjectId().getIdSnapshot().get(ID_PK_COLUMN);
    }

    public void setAdult(Boolean adult) {
        writeProperty("adult", adult);
    }
    public Boolean getAdult() {
        return (Boolean)readProperty("adult");
    }

    public void setColor(Boolean color) {
        writeProperty("color", color);
    }
    public Boolean getColor() {
        return (Boolean)readProperty("color");
    }

    public void setDecensored(Boolean decensored) {
        writeProperty("decensored", decensored);
    }
    public Boolean getDecensored() {
        return (Boolean)readProperty("decensored");
    }

    public void setInfo(String info) {
        writeProperty("info", info);
    }
    public String getInfo() {
        return (String)readProperty("info");
    }

    public void setJapaneseName(String japaneseName) {
        writeProperty("japaneseName", japaneseName);
    }
    public String getJapaneseName() {
        return (String)readProperty("japaneseName");
    }

    public void setPages(Integer pages) {
        writeProperty("pages", pages);
    }
    public Integer getPages() {
        return (Integer)readProperty("pages");
    }

    public void setPublished(Date published) {
        writeProperty("published", published);
    }
    public Date getPublished() {
        return (Date)readProperty("published");
    }

    public void setRating(Rating rating) {
        writeProperty("rating", rating);
    }
    public Rating getRating() {
        return (Rating)readProperty("rating");
    }

    public void setRomajiName(String romajiName) {
        writeProperty("romajiName", romajiName);
    }
    public String getRomajiName() {
        return (String)readProperty("romajiName");
    }

    public void setTranslated(Boolean translated) {
        writeProperty("translated", translated);
    }
    public Boolean getTranslated() {
        return (Boolean)readProperty("translated");
    }

    public void setTranslatedName(String translatedName) {
        writeProperty("translatedName", translatedName);
    }
    public String getTranslatedName() {
        return (String)readProperty("translatedName");
    }

    public void setType(Type type) {
        writeProperty("type", type);
    }
    public Type getType() {
        return (Type)readProperty("type");
    }

    public void addToArtists(Artist obj) {
        addToManyTarget("artists", obj, true);
    }
    public void removeFromArtists(Artist obj) {
        removeToManyTarget("artists", obj, true);
    }
    @SuppressWarnings("unchecked")
    public Set<Artist> getArtists() {
        return (Set<Artist>)readProperty("artists");
    }


    public void addToCircles(Circle obj) {
        addToManyTarget("circles", obj, true);
    }
    public void removeFromCircles(Circle obj) {
        removeToManyTarget("circles", obj, true);
    }
    @SuppressWarnings("unchecked")
    public Set<Circle> getCircles() {
        return (Set<Circle>)readProperty("circles");
    }


    public void addToContents(Content obj) {
        addToManyTarget("contents", obj, true);
    }
    public void removeFromContents(Content obj) {
        removeToManyTarget("contents", obj, true);
    }
    @SuppressWarnings("unchecked")
    public Set<Content> getContents() {
        return (Set<Content>)readProperty("contents");
    }


    public void setConventionof(Convention conventionof) {
        setToOneTarget("conventionof", conventionof, true);
    }

    public Convention getConventionof() {
        return (Convention)readProperty("conventionof");
    }


    public void addToParodies(Parody obj) {
        addToManyTarget("parodies", obj, true);
    }
    public void removeFromParodies(Parody obj) {
        removeToManyTarget("parodies", obj, true);
    }
    @SuppressWarnings("unchecked")
    public Set<Parody> getParodies() {
        return (Set<Parody>)readProperty("parodies");
    }

    public void setRecycled(Boolean recycled) {
        writeProperty("recycled", recycled);
    }
    public Boolean getRecycled() {
        return (Boolean)readProperty("recycled");
    }
    
    protected abstract void postAdd();
}
